Imports System.Web
Imports System.Text.RegularExpressions
Public Class IWebVersion
    Public Shared Function GetVersion() As IWebVersion_Info
        Dim IWeb As New IWebservice.WebService
        IWeb.Url = IWeb_Form.WebserviceURL
        IWeb.IWebAuthendicationHeaderValue = IWebAuthendication.AttachCredentials()
        Dim IWebVersion_Info As New IWebVersion_Info()
        IWebVersion_Info.VersionName = IWeb.GetVersion()
        IWebVersion_Info.VersionNumber = CInt(Regex.Replace(IWebVersion_Info.VersionName, "\D", ""))
        Return IWebVersion_Info
    End Function
    Public Shared Function CheckVersion(ByVal VersionToCheck As Integer) As Boolean
        Dim IWeb As New IWebservice.WebService
        IWeb.Url = IWeb_Form.WebserviceURL
        IWeb.IWebAuthendicationHeaderValue = IWebAuthendication.AttachCredentials()
        Dim boolReturnValue As Boolean = False
        Try
            If (VersionToCheck > CInt(Regex.Replace(IWeb.GetVersion(), "\D", ""))) Then
                boolReturnValue = False
            Else
                boolReturnValue = True
            End If
        Catch ex As Exception
            boolReturnValue = False
        End Try

        Return boolReturnValue
    End Function
End Class
